//
//  UTests.swift
//  iPhoneUTests
//
//  Created by Toj on 3/28/23.
//

import XCTest

class UTests: XCTestCase {

    override func setUpWithError() throws {
        // Put setup code here. This method is called before the invocation of each test method in the class.
    }

    override func tearDownWithError() throws {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
    }
    
    func testExample() throws {
        print("-->UTests: start \n")
        
        print("-->UTests: test10 name: \(STLikeApi.test1(name: "test1").name)")
        print("-->UTests: test11 name: \(STLikeApi.test11(name: "test11").name)")
        print("-->UTests: test12 name: \(STLikeApi.test12(name: "test12").name)")
        print("-->UTests: test13 name: \(STLikeApi.test13(name: "test13").name)")
        
        print("-->UTests: test20 name: \(STLikeApi.test2(name: "test2").name)")
        print("-->UTests: test21 name: \(STLikeApi.test21(name: "test21").name)")
        print("-->UTests: test22 name: \(STLikeApi.test22(name: "test22").name)")
        print("-->UTests: test23 name: \(STLikeApi.test23(name: "test23").name)")
        print("-->UTests: test24 name: \(STLikeApi.test24(name: "test24").name)")
        
        print("-->UTests: test30 name: \(STLikeApi.test3(ID: "test3").name)")
        
        print("-->UTests: test40 name: \(STLikeApi.test4(ID: "test4").name)")
     
        print("-->UTests: end \n")
    }

    func testPerformanceExample() throws {
        // This is an example of a performance test case.
        self.measure {
            // Put the code you want to measure the time of here.
        }
    }
}

enum STLikeApi {
    case test1(name: String)
    case test11(name: String)
    case test12(name: String)
    case test13(name: String)
    case test2(name: String)
    case test21(name: String)
    case test22(name: String)
    case test23(name: String)
    case test24(name: String)
    case test3(ID: String)
    case test4(ID: String)
}
extension STLikeApi {
    var name: String {
        switch self {
        case
            let .test1(name),
            let .test11(name),
            let .test12(name),
            let .test13(name),
            let .test2(name),
            let .test21(name),
            let .test22(name),
            let .test23(name),
            let .test24(name):
            return name
        case let .test3(ID):
            return ID
        default:
            return ""
        }
    }
}
